<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系统参数修改</title>
<link href="${ctx }/css/style.css" rel="stylesheet" type="text/css" />
<link href="${ctx }/js/layui/css/layui.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="${ctx }/js/niceValidator/jquery.validator.css" />
<script type="text/javascript" src="${ctx }/js/jquery/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="${ctx }/js/layer/layer.js"></script>
<script type="text/javascript" src="${ctx }/js/niceValidator/jquery.validator.js"></script>
<script type="text/javascript" src="${ctx }/js/niceValidator/local/zh_CN.js"></script>
<script type="text/javascript" src="${ctx }/js/common.js"></script>
</head>
<body>
<div class="listNavTitle">
    <p>
        <label>系统管理 ></label>
        <label>系统参数管理</label>
    </p>
</div>
<div class="formbody">
  <div class="formtitle"><span>修改系统参数</span></div>
<form id="submitForm">
  <input type="hidden" name="id" value="${systemParam.id}"/>
  <ul class="forminfo">
	 <li>
      <label>类别ID</label>
     <select name="typeId">
         <option value="">请选择</option>
         <#list paramTypeList as type>
             <option value="${type.id}" <#if systemParam.typeId == type.id>selected="selected"</#if>>${type.name}</option>
         </#list>
     </select>
   	 </li>
      <li>
          <label>字典数据</label>
          <select name="dicType" id="dicTypesel" onchange="dicList('2');">
              <option value=>请选择</option>
          <#list dicTypeList as dicType>
              <option value="${dicType.id}" <#if dic.dicTypeId == dicType.id>selected="selected"</#if>>${dicType.name}(${dicType.typeCode})</option>
          </#list>
          </select>
          <select name="dicId" id="dicIdsel">
              <option value=>请选择</option>
          </select>
      </li>
      <li>
          <label>行政区域</label>
          <input name="areaName" type="text" class="dfinput"  readonly="readonly" value="${systemArea.fullAreaName}"/>
          <input type="hidden" name="areaId" value="${systemArea.id}" />
      </li>
	 <li>
      <label>名称</label>
      <input name="name" value="${systemParam.name}" type="text" class="dfinput"  data-rule="名称:required;"/>
   	 </li>
	 <li>
      <label>备注</label>
      <input name="remarks" value="${systemParam.remarks}" type="text" class="dfinput"  data-rule="备注:required;"/>
   	 </li>
    <li>
      <label>&nbsp;</label>
      <button class="layui-btn layui-btn-normal" type="button" class="btn" id="submitBtn">确认保存</button>
    </li>
  </ul>
</form>
</div>
</body>
</html>
<script>
    $(document).ready(function(){
        $("#submitBtn").click(function(){
            baseEdit('${ctx }/sysman/systemParam/upChange.do');
        });

        dicList('1');
    });

    function dicList(type){
        var dicTypeId = $("#dicTypesel option:selected").val();
        if(panIsNull(dicTypeId)){
            return;
        }
        $("#dicIdsel").html('<option value>请选择</option>');
        var loadi = layer.load();
        $.ajax({
            type : "POST",
            url : '${ctx}/sysman/systemDic/innList.do',
            data : {"dicTypeId":dicTypeId},
            dataType : "json",
            success : function(data) {
                layer.close(loadi);
                var options = '<option value>请选择</option>';
                for(var i = 0;i<data.length;i++){
                    options = options + "<option value='"+data[i].id+"'>"+data[i].name+"</option>";
                }
                $("#dicIdsel").html(options);
                if(type == '1'){
                    $('#dicIdsel').val('${systemParam.dicId}');
                }
            }
        });
    }
</script>